open(BUFF,"affy_GBM.sdrf");
while(<BUFF>)
{
	chomp($_);
	@a = split(/\t/,$_);
	#@a1 = split('-',$a[0]);
	#$samp = $a1[0]."-".$a1[1]."-".$a1[2];
	#print $samp."\n";
	#$hash{$samp} = 'AFFY';
	$hash{$a[0]} = 'AFFY';
}
open(BUFF,"ILLGBM");
while(<BUFF>)
{
        chomp($_);
        @a = split(/ /,$_);
        #@a1 = split('-',$a[0]);
        #$samp = $a1[0]."-".$a1[1]."-".$a1[2];
        #print $samp."\n";
        #$hash{$samp} = 'AFFY';
        $hash{$a[0]} = 'ILL';
}
open(BUFF,"merged_removeddup_normal.tfam");
$n =0;
$n1 =0;
open(AFFY,">AFFY_200samples");
open(ILL,">ILL_200samples");
while(<BUFF>)
{
        chomp($_);
        @a = split(/ /,$_);
	if(exists($hash{$a[0]}))
	{
		#print $hash{$a[0]}."\n";
		if($hash{$a[0]} eq 'AFFY')
		{
			$n++;
			if($n < 201)
			{
				print AFFY $_."\n";
			}		
		}
		else
		{
			$n1++;
			if($n1 < 201)
                        {
                                print ILL $_."\n";
                        }

		}
	}
	else
	{
		#print "$_\n";
	}
	print $hash{$a[0]}."\n";
			
}

print "num $n\n";
